<?php

namespace App\Models\Bus;

use App\Models\Model;
use App\User;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class BusScrap extends Model
{
    protected $table = 'akbus_bus_scrap';

    protected $fillable = [
        'bus_id',
        'scrap_time',
        'note',
        'user_id',
    ];
    /**
     * 类型转化
     *
     * @var array
     */
    protected $casts = [
    ];

    /**
     * 关联模型bus
     */
    public function bus(): BelongsTo
    {
        return $this->belongsTo(Bus::class,'bus_id','id');
    }

    /**
     * 关联模型user
     */
    public function user(): belongsTo
    {
        return $this->belongsTo(User::class,'user_id','id');
    }
}
